cc.Class({
    extends: cc.Component,

    properties: {
        
    },

    onLoad () {
        this.txtName = this.node.find('txtName', cc.RichText);
        this.node.opacity = 0;
        this.motor = null;
    },

    updateTip(motor) {
        if(!this.motor) {
            this.motor = motor;
            return;
        }
        if(this.node.getNumberOfRunningActions() > 0) {
            return;
        }
        if(this.motor != motor) {
            this.motor = motor;
            var index = '红绿蓝紫黄'.indexOf(motor.node.getComponent(dragonBones.ArmatureDisplay).armatureName);
            this.txtName.string = '<b><color=#0ffffff><outline color=black width=2>00' + (++index) + '</outline></color></b>';
            this.playAnim();
        }
    },

    playAnim() {
        this.node.opacity = 255;
        this.node.setScale(0.6);
        this.node.runAction(cc.sequence(
            cc.scaleTo(0.2, 1).easing(cc.easeBackOut()),
            cc.delayTime(0.5),
            cc.fadeOut(0.5)
        ));
    }

});
